package com.power.using.myapplication.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.power.using.myapplication.R;
import com.power.using.myapplication.base.BaseMainFragment;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by 聪明一只哈 on 2018/5/25.
 * Time: 2018/5/25  10:35
 */

public class ThreeFrament extends BaseMainFragment {

   // private Banner homeMZBanner;
    private RecyclerView homeRV;
    private TextView toolTitle;
    private ImageView mMenu;

    private static final int[] image = {R.drawable.banner_four, R.drawable.banner_two, R.drawable.banner_three};


    public static ThreeFrament newInstance() {

        Bundle args = new Bundle();

        ThreeFrament fragment = new ThreeFrament();
        fragment.setArguments(args);
        return fragment;
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {

        View view = inflater.inflate(R.layout.fragment_home, container, false);
        initView(view);
        return view;
    }

    private void initView(View view) {
        toolTitle = (TextView) view.findViewById(R.id.toolbar_title);
       // homeMZBanner = (Banner) view.findViewById(R.id.home_banner);
        mMenu = (ImageView) view.findViewById(R.id.toolbar_iv_menu);
        mMenu.setImageResource(R.drawable.notifa_ime);
        mMenu.setVisibility(View.VISIBLE);
        homeRV = (RecyclerView) view.findViewById(R.id.home_rv);
        toolTitle.setText("33");
    }

    //懒加载

    @Override
    public void onLazyInitView(@Nullable Bundle savedInstanceState) {
        super.onLazyInitView(savedInstanceState);
        initMZBanner();
//        initRVData();
//        initListener();
    }

    //加载轮播
    private void initMZBanner() {
        List<Integer> list = new ArrayList();
        for (int i = 0; i < image.length; i++) {
            list.add(image[i]);
        }
        //设置图片加载器
//        homeMZBanner.setImageLoader(new GlideImageLoader());
//        //设置图片集合
//        homeMZBanner.setImages(list);
//        //设置指示器及其位置
//        homeMZBanner.setBannerStyle(BannerConfig.CIRCLE_INDICATOR);
//        homeMZBanner.setIndicatorGravity(BannerConfig.CENTER);
//        //设置自动播放
//        homeMZBanner.isAutoPlay(true);
//        //设置时间
//        homeMZBanner.setDelayTime(3000);
//        //设置banner动画效果
//        homeMZBanner.setBannerAnimation(Transformer.DepthPage);
//        //banner设置方法全部调用完毕时最后调用
//        homeMZBanner.start();
    }
}
